<script>
	// import {
	// 	useUserStore
	// } from '@/stores/user.js'
	// import {
	// 	loginTokenKey
	// } from '@/constant/index.js'
	// import {
	// 	checkAppVersion
	// } from "@/utils/function.js"
	import {
		useAppStore
	} from '@/stores/app.js'
	export default {
		onLaunch: function() {
			useAppStore().setCustomBar()
			// checkAppVersion(true) 
			// const userStore = useUserStore()
			// let storeToken = uni.getStorageSync(loginTokenKey);
			// if (storeToken) {
			// 	userStore.setUserInfo().then(res => {
			// 		this.toHome()
			// 	}).catch(err => {
			// 		this.toLogin()
			// 	})
			// } else {
			// 	this.toLogin()
			// }

		},
		onShow: function() {},
		onHide: function() {},
		methods: {
			toHome() {
				//仅app 端 已登录直接跳转首页，
				// #ifdef APP-PLUS
				uni.reLaunch({
					url: "/pages/index/index",
					success: () => {
						this.closeSplash()
					}
				})
				// #endif
			},
			toLogin() {
				//仅app 端 已登录直接跳转首页，
				// #ifdef APP-PLUS
				uni.reLaunch({
					url: "/pages/login/login",
					success: () => {
						this.closeSplash()
					}
				})
				// #endif
			},
			closeSplash() {
				// #ifdef APP-PLUS 
				setTimeout(() => {
					plus.navigator.closeSplashscreen()
				}, 1000)
				// #endif

			}
		}
	}
</script>

<style>
	/* @import "@/styles/tailwind.css"; */

	/*每个页面公共css */
	.page {
		background-color: #F5F5F5;
	}
</style>

<style lang="scss">
	@import 'tailwindcss/base';
	@import 'tailwindcss/utilities';
	/*每个页面公共css */
	@import "uni_modules/uview-plus/index.scss";
	@import './styles/global.scss';
	
	
	/*每个页面公共css */
	@import '@/uni_modules/uni-scss/index.scss';
	/* #ifndef APP-NVUE */
	@import '@/static/customicons.css';
	// 设置整个项目的背景色
	page {
		background-color: #f5f5f5;
	}
	/* #endif */
	@import "@/static/iconfont/iconfont.css";
	
	@import '@/common/uni.css';
	
	@import '@/common/default.scss';
	
	
	.example-info {
		font-size: 14px;
		color: #333;
		padding: 10px;
	}

	page {
		--app-bar-height: 44px;
		--icon-size: 21rpx;
		background-color: $uni-bg-color;
	}
</style>